package collection;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

public class NewForDemo {
    public static void main(String[] args) {

        String[] array = {"one", "two", "three", "four", "five", "six"};
        for (int i = 0; i < array.length; i++) {
            System.out.print(array[i]);
        }
        for(String str:array){
            System.out.print(str);
        }
        System.out.println("------------------------------------");




        Collection<String> aa=new ArrayList();
        aa.add("one");
        aa.add("two");
        aa.add("three");
        aa.add("four");
        aa.add("five");
        aa.add("six");
        Iterator<String> it = aa.iterator();
        while(it.hasNext()){
            String str=it.next();
            System.out.print(str);
        }
        for(String str: aa){
            System.out.println(str);
        }
    }
}
